{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import random\n",
    "import os\n",
    "import shutil"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "os.mkdir('data/forecasting_dataset')\n",
    "os.mkdir('data/forecasting_dataset/train')\n",
    "os.mkdir('data/forecasting_dataset/val')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "filepath = \"data/val/data/\"\n",
    "filenames = os.listdir(filepath)\n",
    "random.shuffle(filenames)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_path = 'data/forecasting_dataset/train/'\n",
    "val_path = 'data/forecasting_dataset/val/'\n",
    "total = len(filenames)\n",
    "for i in range(300):\n",
    "    shutil.copy(filepath+filenames[i], train_path+filenames[i])\n",
    "\n",
    "for i in range(total-100, total):\n",
    "    shutil.copy(filepath+filenames[i], val_path+filenames[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:sassd] *",
   "language": "python",
   "name": "conda-env-sassd-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
